﻿<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<title>Web报表(B/S报表)演示 - 在明细网格中显示图表</title>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
	<script src="../../CreateControl.js" type="text/javascript"></script>
	<script type="text/javascript">
function window_onload() {
    ReportViewer.Stop();
    
    var Report = ReportViewer.Report;
    Report.OnChartRequestData = OnChartRequestData;

    //启动报表运行
    ReportViewer.Start();
}

function OnChartRequestData(Chart) {
    var Report = ReportViewer.Report,
		CategoryID;
    
    if (Chart.Name == "DetailChart") { //判断是哪个图表触发的事件,如果报表中仅有唯一的图表,可以不判断
		CategoryID = Report.FieldByName("CategoryID").AsInteger;
        Chart.Recordset.LoadData("xmlChartInDetailGrid.jsp?CategoryID=CategoryID");
	}
}
    </script>

    <style type="text/css">
        html,body {
            margin:0;
            height:100%;
        }
    </style>
</head>
<body style="margin:0" onload="return window_onload()">
    <script type="text/javascript"> 
	    CreatePrintViewerEx("100%", "100%", "ChartInDetailGrid.grf", "../../../data/Categories.jsp", false, "");
	    //CreateDisplayViewerEx("100%", "100%", "ChartInDetailGrid.grf", "../../../data/Categories.jsp", false, "");
    </script>
</body>
</html>
